<?php
/*
 * Using HTML helper!!!
 */
?>
<div id="servitius_content" >
    <h2>Article list</h2>
    <?php  // if there is a message, we print it here
    if(isset($message) && $message != ''):
    ?>
    <div id="message"><?php echo $message; ?><br /></div>
    <?php endif; ?>
    
    <table class="box-table-a">
        <tr>
            <th>id</th>
            <th>title</th>
            <th>excrept</th>
            <th style="width: 20px;">edit</th>
            <th>delete</th>
        </tr>
        <?php
        foreach ($articles->result() as $article){
            ?>
        <tr>
            <td><?php echo $article->id?></td>
            <td><?php echo $article->title?></td>
            <td><?php echo character_limiter($article->text,20)?></td>
            <td><?php echo anchor('admin/articles/edit/'.$article->id, img("/images/admin/edit.png"), array('title' => 'Edit article'));?></td>
            <td>
                <a onclick="javascript:confirm('Biztos?')" href="<?php 
                echo base_url() ?>admin/articles/delete/<?php 
                echo $article->id ?>"><?php
                echo img("/images/admin/delete.png"); ?></a></td>
        </tr>
            <?php
        }
        ?>
        <tr>
            <td colspan="5" style="text-align: center;"><?php echo anchor('admin/articles/edit_new', img("/images/admin/add.png"), array('title' => 'New article!'));?></td>
        </tr>
    </table>
</div>
